package com.wsserver.service.serviceImpl;


import com.wsserver.dao.UserDao;
import com.wsserver.pojo.User;
import com.wsserver.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.jws.WebService;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;

@Service
@WebService
//服务接口方法的实现
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;


    @Override
    @POST
    public int addUser(User user) {
       return userDao.addUser(user);
    }

    @DELETE
    @Override
    public int deleteUser(Integer id) {
        return userDao.deleteUser(id);
    }

    @Override
    @PUT
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    @GET
    public User queryUser(Integer id) {
        return userDao.queryUser(id);
    }
}
